import 'package:amap_flutter_location/amap_flutter_location.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:package_info/package_info.dart';
import 'package:sp_util/sp_util.dart';
import 'package:yp/app.dart';
import 'package:yp/jpusher.dart';
import 'package:yp/logic.dart';
import 'package:yp/utils/util.dart';
import 'config/config.dart';
import 'package:fluwx/fluwx.dart' as fluwx;

void main() async {
  loadingShow();
  WidgetsFlutterBinding.ensureInitialized();
  LogUtil.init(isDebug: true);

  await SpUtil.getInstance();
  if (!kIsWeb) {
    // if (GetPlatform.isAndroid) {
    //   Config.loginScreenStyle = '0';
    // } else {
      GlobalLogic.getLoginScreenStyle();
    // }
  } else {
    Config.loginScreenStyle = '0'; 
  }
  if (!kIsWeb) {
    //强制屏幕方向在web上不支持
    SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
        .then((_) {
      // Get.put(Discovery());
      // Get.put(Order());
      // Get.put(Trolley());
      // Get.put(Member());
      Get.put(GlobalLogic());
      // Get.put(WorkbenchLogic());
      // Get.put(UserLogic());

      runApp(new MyApp());
    });
  } else {
    Get.put(GlobalLogic());
    runApp(new MyApp());
  }
}
